let obj = {
    name: '困困',
    age: 18,
    like: {
        a: '唱',
        b: '跳',
        c: 'rap'
    }
}
function shallowCopy(obj) {
    let newObj = {}
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) { //判断key是不是obj显示拥有的
            newObj[key] = obj[key]
        }
    }  
    return newObj
}
console.log(shallowCopy(obj))